home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_c / cuj0696.zip / DWYER.ZIP / QFLOAT / QHEAD.ASM < prev    next >
Assembly Source File  |  1996-02-24  |  812b  |  37 lines

  1.  
  2. _TEXT    SEGMENT  BYTE PUBLIC 'CODE'
  3. _TEXT    ENDS
  4. CONST    SEGMENT  WORD PUBLIC 'CONST'
  5. CONST    ENDS
  6. _BSS    SEGMENT  WORD PUBLIC 'BSS'
  7. _BSS    ENDS
  8. _DATA    SEGMENT  WORD PUBLIC 'DATA'
  9. _DATA    ENDS
  10. DGROUP    GROUP    CONST,    _BSS,    _DATA
  11.     ASSUME  CS: _TEXT, DS: DGROUP, SS: DGROUP, ES: DGROUP
  12.  
  13. ; number of 16 bit words in the entire number format
  14. NQ = 24        ; 24, 12
  15. ; number of iterations for a divide: 3 -> 77 decimal accuracy
  16. NQDIV = 4    ;  4,  3
  17.  
  18. ; number of 16 bit words in mantissa area:
  19. OMG = NQ-2
  20. ; byte offset to last word of mantissa area = 2*OMG+2:
  21. OFFS = OMG+OMG+2
  22.  
  23.  
  24. zmul    MACRO    a,b
  25. ao = 6 + 2*a
  26. bo = 6 + 2*b
  27. co = 8 + 2*a + 2*b
  28. do = 6 + 2*a + 2*b
  29. eo = 4 + 2*a + 2*b
  30.     mov    ax, word ptr [di]+ao
  31.     mul    word ptr [si]+bo
  32.     add    word ptr [bx]+co,ax
  33.     adc    word ptr [bx]+do,dx
  34.     adc    word ptr [bx]+eo,cx
  35.     ENDM
  36.  
  37.